void a(vector<TH1F *> &v, TObject *h){ v.push_back((TH1F *)h); }
void d2dc(){
  TFile *f = new TFile(getenv("TMP1"), "UPDATE");
  TTree *etf = (TTree *)f->Get("etf");
  vector<TH1F *> v;
  const char *cut = "";

  // --------------------- 2. Wire Id Distribution ------------------------ //
  const char xuv[3] = {'X', 'U', 'V'};
  char hname[64]{}, cmd[512]{};
  int id = 0;
  for(int i = 0; i < 3; i++){
    sprintf(hname, "h%d", ++id);
    // etf->Draw("postMagTrackerX.GetD2()>>h1(500, -1.5, 300.)", "", "");
    sprintf(cmd, "postMagTracker%c.GetD2()>>%s(500, -30., 400.)", xuv[i], hname);
    etf->Draw(cmd, cut); a(v,f->Get(hname));
  } // end for over x,u,v

  TCanvas *c1 = new TCanvas("c", "D-square Distribution for post Mag dcs", 1680, 1050);
  c1->Divide(2,2);
  for(int i = 0; i < 3; i++){
    c1->cd(i+1); v[i]->Draw();
  } // end for
  c1->Print("d2dc.pdf");
} // end vis

